﻿using System;
namespace System.Data.Services.Client
{
    /// <summary>
    /// Describes the insert/update/delete state of an entity or link.
    /// </summary>
    /// <remarks>
    /// Deleting an inserted resource will detach it.
    /// After SaveChanges, deleted resources will become detached and Added &amp; Modified resources will become unchanged.
    /// </remarks>
    [Flags]
    public enum EntityStates
    {
        /// <summary>
        /// The resource is not tracked by the context.
        /// </summary>
        Detached = 1,
        /// <summary>
        /// The resource is tracked by a context with no changes.
        /// </summary>
        Unchanged = 2,
        /// <summary>
        /// The resource is tracked by a context for insert.
        /// </summary>
        Added = 4,
        /// <summary>
        /// The resource is tracked by a context for deletion.
        /// </summary>
        Deleted = 8,
        /// <summary>
        /// The resource is tracked by a context for update.
        /// </summary>
        Modified = 16
    }
}
